//
//  JBWSimpleRegisterWordViewController.m
//  JBWDSK
//
//  Created by 崔志伟 on 2018/7/27.
//  Copyright © 2018年 崔志伟. All rights reserved.
//

#import "JBWSimpleRegisterWordViewController.h"
#import "JBWDelegateView.h"

@interface JBWSimpleRegisterWordViewController ()
@property (nonatomic,strong) UIView *editBgView  ;
@property (nonatomic,strong) UITextField  * passwordTextField ;
@property (nonatomic,strong) UIButton *showPasswordBtn  ;
@property (nonatomic,strong) UIButton  * registerBtn ;

@end

@implementation JBWSimpleRegisterWordViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor clearColor];
    self.bgContentViewHight = 220.0f;
    self.backTitle = @"一键注册";
    [self setUpInputPasswordView];
    [self setUpRegisterBtn];

}

- (void)setUpInputPasswordView {
    self.editBgView = [[UIView alloc]initWithFrame:CGRectMake(20, 75, MAIN_BG_VIEW_WIDTH-40, 44)];
    self.editBgView .backgroundColor = [UIColor whiteColor];
    self.editBgView .layer.cornerRadius = 5.f;
    self.editBgView .layer.masksToBounds = YES;
    [self.bgContentView addSubview:self.editBgView ];
    self.passwordTextField = [[UITextField alloc]initWithFrame:CGRectMake(5, 0, CGRectGetWidth(self.editBgView .frame)-40, 44)];
    self.passwordTextField.font =  [UIFont systemFontOfSize:13];
    self.passwordTextField.placeholder = @"密码（6-20数字或字母）";
    [self.editBgView  addSubview:self.passwordTextField];
   self.showPasswordBtn = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.passwordTextField.frame), 0, 30, 44)];
    [self.showPasswordBtn setImage:GetImageNamed(@"sdk_login_ic_cansee") forState:UIControlStateNormal];
    [self.showPasswordBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.showPasswordBtn addTarget:self action:@selector(showPasswordBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.editBgView  addSubview:self.showPasswordBtn];
}

-(void)setUpRegisterBtn{
    
    self.registerBtn = [[UIButton alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(self.editBgView.frame)+15, MAIN_BG_VIEW_WIDTH-40, 44)];
    self.registerBtn.backgroundColor = [UIColor orangeColor];
    [self.registerBtn setTitle:@"注册" forState:UIControlStateNormal];
    self.registerBtn .layer.cornerRadius = 5.f;
    self.registerBtn .layer.masksToBounds = YES;
    [self.registerBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.registerBtn addTarget:self action:@selector(registerBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.bgContentView addSubview:self.registerBtn];
    
    JBWDelegateView * delegateView = [[JBWDelegateView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.registerBtn.frame), MAIN_BG_VIEW_WIDTH, 220.0f -CGRectGetMaxY(self.registerBtn.frame))];
    [self.bgContentView addSubview:delegateView];
    
    
}

- (void)showPasswordBtnAction{
    
    
}
#pragma mark -- 注册
- (void)registerBtnAction{
    [self dismissViewControllerAnimated:NO completion:self.dismissBlock];

}

@end
